<!DOCTYPE html>
<meta charset="utf-8">
<title>Computed visibility is inherited</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<!-- Test for https://github.com/jsdom/jsdom/issues/2616 -->

<style>
  #parent {
    visibility: hidden;
  }
</style>

<body>
  <div id="parent">
      <div id="child">Hello, Dave!</div>
  </div>
</body>

<script>
"use strict";

test(() => {
  const element = document.querySelector("#parent");
  assert_equals(getComputedStyle(element).visibility, "hidden");
}, "Sanity check: getComputedStyle returns apparent visibility");

test(() => {
  const element = document.querySelector("#child");
  assert_equals(getComputedStyle(element).visibility, "hidden");
}, "Children inherit visibility from their parents");
</script>
